package org.yscz.task;

import lombok.Builder;
import lombok.Data;

import java.util.Objects;

@Builder
public class AbnormalEmotion  implements Comparable<AbnormalEmotion>{
    // 图片名
    private String imageName;

    // 时间戳
    private Long timeStamp;

    // 图片分数
    private Integer imageScore = 0;


    public String getImageName() {
        return imageName;
    }

    public void setImageName(String imageName) {
        this.imageName = imageName;
    }

    public Long getTimeStamp() {
        return timeStamp;
    }

    public void setTimeStamp(Long timeStamp) {
        this.timeStamp = timeStamp;
    }

    public Integer getImageScore() {
        return imageScore;
    }

    public void setImageScore(Integer imageScore) {
        this.imageScore = imageScore;
    }

    public AbnormalEmotion(String imageName, Long timeStamp, Integer imageScore) {
        this.imageName = imageName;
        this.timeStamp = timeStamp;
        this.imageScore = imageScore;
    }

    public AbnormalEmotion() {
    }

    @Override
    public int compareTo(AbnormalEmotion o) {
        return o.imageScore - this.imageScore;
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;
        AbnormalEmotion that = (AbnormalEmotion) o;
        return Objects.equals(imageName, that.imageName) &&
                Objects.equals(timeStamp, that.timeStamp) &&
                Objects.equals(imageScore, that.imageScore);
    }

    @Override
    public int hashCode() {
        return Objects.hash(imageName, timeStamp, imageScore);
    }

    @Override
    public String toString() {
        return "AbnormalEmotion{" +
                "imageName='" + imageName + '\'' +
                ", timeStamp=" + timeStamp +
                ", imageScore=" + imageScore +
                '}';
    }
}
